struct testMsg
{
	testMsg()
	{
		pChar[0] = '\0';
		nSize = 5;
	}
	char pChar[1];
	int nSize;

};

template<typename T>
T* CreateDynamicLengthMsg(int nSize,const T*)
{
	T* pMsg = (T*)new char[nSize];
	if(pMsg)
	{
		//*pMsg = T();
		new ((void*)pMsg) T();
		pMsg->nSize = nSize;
	}
	return pMsg;
};


struct SumRatea
{
	void operator()( int t )
	{
		m_nSum += t; 
	}
	operator int()
	{
		return m_nSum;
	}
	int m_nSum;
};

//sum_all()
template<typename _Type> inline
_Type sum_all(_Type* pFirst,_Type* pLast)
{
	_Type sum;
	for(sum = 0;pFirst!=pLast;++pFirst)
	{
		sum += *pFirst;
	}
	return sum;
};